<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class Gem::Platform - rubygems: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link">Object
</div>

        
        
<div id="extends-section" class="nav-section">
  <h3>Extended With Modules</h3>

  <ul class="link-list">
    <li><a class="extend" href="Deprecate.html">Gem::Deprecate</a>
  </ul>
</div>

        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-installable-3F">::installable?</a>
    <li ><a href="#method-c-local">::local</a>
    <li ><a href="#method-c-match">::match</a>
    <li ><a href="#method-c-match_gem-3F">::match_gem?</a>
    <li ><a href="#method-c-match_platforms-3F">::match_platforms?</a>
    <li ><a href="#method-c-match_spec-3F">::match_spec?</a>
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-c-sort_priority">::sort_priority</a>
    <li ><a href="#method-i-3D-3D">#==</a>
    <li ><a href="#method-i-3D-3D-3D">#===</a>
    <li ><a href="#method-i-3D~">#=~</a>
    <li ><a href="#method-i-eql-3F">#eql?</a>
    <li ><a href="#method-i-normalized_linux_version">#normalized_linux_version</a>
    <li ><a href="#method-i-to_a">#to_a</a>
    <li ><a href="#method-i-to_s">#to_s</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-Gem::Platform">
    <h1 id="class-Gem::Platform" class="class">
      class Gem::Platform
    </h1>

    <section class="description">
    
<p>Available list of platforms for targeting <a href="../Gem.html"><code>Gem</code></a> installations.</p>

<p>See ‘gem help platform` for information on platform matching.</p>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="CURRENT">CURRENT
          <dd><p>A platform-specific gem that is built for the packaging Ruby’s platform. This will be replaced with <a href="Platform.html#method-c-local"><code>Gem::Platform::local</code></a>.</p>
          <dt id="RUBY">RUBY
          <dd><p>A pure-Ruby gem that may use <a href="Specification.html#method-i-extensions"><code>Gem::Specification#extensions</code></a> to build binary files.</p>
        </dl>
        </section>

        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-cpu" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">cpu</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-os" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">os</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-version" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">version</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-installable-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">installable?</span><span
                                class="method-args">(spec)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="installable-3F-source">
            <pre><span class="ruby-comment"># File rubygems/platform.rb, line 54</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">installable?</span>(<span class="ruby-identifier">spec</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-value">:installable_platform?</span>
    <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">installable_platform?</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">match_spec?</span> <span class="ruby-identifier">spec</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-local" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">local</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="local-source">
            <pre><span class="ruby-comment"># File rubygems/platform.rb, line 15</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">local</span>
  <span class="ruby-identifier">arch</span> = <span class="ruby-constant">RbConfig</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-string">&quot;arch&quot;</span>]
  <span class="ruby-identifier">arch</span> = <span class="ruby-node">&quot;#{arch}_60&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-regexp">/mswin(?:32|64)$/</span>.<span class="ruby-identifier">match?</span>(<span class="ruby-identifier">arch</span>)
  <span class="ruby-ivar">@local</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">new</span>(<span class="ruby-identifier">arch</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-match" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">match</span><span
                                class="method-args">(platform)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="match-source">
            <pre><span class="ruby-comment"># File rubygems/platform.rb, line 21</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">match</span>(<span class="ruby-identifier">platform</span>)
  <span class="ruby-identifier">match_platforms?</span>(<span class="ruby-identifier">platform</span>, <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">platforms</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-match_gem-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">match_gem?</span><span
                                class="method-args">(platform, gem_name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="match_gem-3F-source">
            <pre><span class="ruby-comment"># File rubygems/platform.rb, line 44</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">match_gem?</span>(<span class="ruby-identifier">platform</span>, <span class="ruby-identifier">gem_name</span>)
  <span class="ruby-comment"># NOTE: this method might be redefined by Ruby implementations to</span>
  <span class="ruby-comment"># customize behavior per RUBY_ENGINE, gem_name or other criteria.</span>
  <span class="ruby-identifier">match_platforms?</span>(<span class="ruby-identifier">platform</span>, <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">platforms</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-match_spec-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">match_spec?</span><span
                                class="method-args">(spec)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="match_spec-3F-source">
            <pre><span class="ruby-comment"># File rubygems/platform.rb, line 40</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">match_spec?</span>(<span class="ruby-identifier">spec</span>)
  <span class="ruby-identifier">match_gem?</span>(<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">platform</span>, <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">name</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(arch)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File rubygems/platform.rb, line 73</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">arch</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">arch</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Array</span> <span class="ruby-keyword">then</span>
    <span class="ruby-ivar">@cpu</span>, <span class="ruby-ivar">@os</span>, <span class="ruby-ivar">@version</span> = <span class="ruby-identifier">arch</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span> <span class="ruby-keyword">then</span>
    <span class="ruby-identifier">arch</span> = <span class="ruby-identifier">arch</span>.<span class="ruby-identifier">split</span> <span class="ruby-string">&quot;-&quot;</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">arch</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">2</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">arch</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp">/\d+(\.\d+)?$/</span> <span class="ruby-comment"># reassemble x86-linux-{libc}</span>
      <span class="ruby-identifier">extra</span> = <span class="ruby-identifier">arch</span>.<span class="ruby-identifier">pop</span>
      <span class="ruby-identifier">arch</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;-#{extra}&quot;</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">cpu</span> = <span class="ruby-identifier">arch</span>.<span class="ruby-identifier">shift</span>

    <span class="ruby-ivar">@cpu</span> = <span class="ruby-keyword">case</span> <span class="ruby-identifier">cpu</span>
           <span class="ruby-keyword">when</span> <span class="ruby-regexp">/i\d86/</span> <span class="ruby-keyword">then</span> <span class="ruby-string">&quot;x86&quot;</span>
           <span class="ruby-keyword">else</span> <span class="ruby-identifier">cpu</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">arch</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">2</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">arch</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^\d+(\.\d+)?$/</span> <span class="ruby-comment"># for command-line</span>
      <span class="ruby-ivar">@os</span>, <span class="ruby-ivar">@version</span> = <span class="ruby-identifier">arch</span>
      <span class="ruby-keyword">return</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">os</span>, = <span class="ruby-identifier">arch</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">os</span>.<span class="ruby-identifier">nil?</span>
      <span class="ruby-ivar">@cpu</span> = <span class="ruby-keyword">nil</span>
      <span class="ruby-identifier">os</span> = <span class="ruby-identifier">cpu</span>
    <span class="ruby-keyword">end</span> <span class="ruby-comment"># legacy jruby</span>

    <span class="ruby-ivar">@os</span>, <span class="ruby-ivar">@version</span> = <span class="ruby-keyword">case</span> <span class="ruby-identifier">os</span>
                    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/aix(\d+)?/</span> <span class="ruby-keyword">then</span>             [<span class="ruby-string">&quot;aix&quot;</span>,       <span class="ruby-node">$1</span>]
                    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/cygwin/</span> <span class="ruby-keyword">then</span>                [<span class="ruby-string">&quot;cygwin&quot;</span>,    <span class="ruby-keyword">nil</span>]
                    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/darwin(\d+)?/</span> <span class="ruby-keyword">then</span>          [<span class="ruby-string">&quot;darwin&quot;</span>,    <span class="ruby-node">$1</span>]
                    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^macruby$/</span> <span class="ruby-keyword">then</span>             [<span class="ruby-string">&quot;macruby&quot;</span>,   <span class="ruby-keyword">nil</span>]
                    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/freebsd(\d+)?/</span> <span class="ruby-keyword">then</span>         [<span class="ruby-string">&quot;freebsd&quot;</span>,   <span class="ruby-node">$1</span>]
                    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^java$/</span>, <span class="ruby-regexp">/^jruby$/</span> <span class="ruby-keyword">then</span>     [<span class="ruby-string">&quot;java&quot;</span>,      <span class="ruby-keyword">nil</span>]
                    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^java([\d.]*)/</span> <span class="ruby-keyword">then</span>         [<span class="ruby-string">&quot;java&quot;</span>,      <span class="ruby-node">$1</span>]
                    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^dalvik(\d+)?$/</span> <span class="ruby-keyword">then</span>        [<span class="ruby-string">&quot;dalvik&quot;</span>,    <span class="ruby-node">$1</span>]
                    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^dotnet$/</span> <span class="ruby-keyword">then</span>              [<span class="ruby-string">&quot;dotnet&quot;</span>,    <span class="ruby-keyword">nil</span>]
                    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^dotnet([\d.]*)/</span> <span class="ruby-keyword">then</span>       [<span class="ruby-string">&quot;dotnet&quot;</span>,    <span class="ruby-node">$1</span>]
                    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/linux-?(\w+)?/</span> <span class="ruby-keyword">then</span>         [<span class="ruby-string">&quot;linux&quot;</span>,     <span class="ruby-node">$1</span>]
                    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/mingw32/</span> <span class="ruby-keyword">then</span>               [<span class="ruby-string">&quot;mingw32&quot;</span>,   <span class="ruby-keyword">nil</span>]
                    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/mingw-?(\w+)?/</span> <span class="ruby-keyword">then</span>         [<span class="ruby-string">&quot;mingw&quot;</span>,     <span class="ruby-node">$1</span>]
                    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/(mswin\d+)(\_(\d+))?/</span> <span class="ruby-keyword">then</span>
                      <span class="ruby-identifier">os</span> = <span class="ruby-node">$1</span>
                      <span class="ruby-identifier">version</span> = <span class="ruby-node">$3</span>
                      <span class="ruby-ivar">@cpu</span> = <span class="ruby-string">&quot;x86&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@cpu</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">os</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/32$/</span>
                      [<span class="ruby-identifier">os</span>, <span class="ruby-identifier">version</span>]
                    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/netbsdelf/</span> <span class="ruby-keyword">then</span>             [<span class="ruby-string">&quot;netbsdelf&quot;</span>, <span class="ruby-keyword">nil</span>]
                    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/openbsd(\d+\.\d+)?/</span> <span class="ruby-keyword">then</span>    [<span class="ruby-string">&quot;openbsd&quot;</span>,   <span class="ruby-node">$1</span>]
                    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/solaris(\d+\.\d+)?/</span> <span class="ruby-keyword">then</span>    [<span class="ruby-string">&quot;solaris&quot;</span>,   <span class="ruby-node">$1</span>]
                    <span class="ruby-comment"># test</span>
                    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^(\w+_platform)(\d+)?/</span> <span class="ruby-keyword">then</span> [<span class="ruby-node">$1</span>,          <span class="ruby-node">$2</span>]
                    <span class="ruby-keyword">else</span> [<span class="ruby-string">&quot;unknown&quot;</span>, <span class="ruby-keyword">nil</span>]
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span> <span class="ruby-keyword">then</span>
    <span class="ruby-ivar">@cpu</span> = <span class="ruby-identifier">arch</span>.<span class="ruby-identifier">cpu</span>
    <span class="ruby-ivar">@os</span> = <span class="ruby-identifier">arch</span>.<span class="ruby-identifier">os</span>
    <span class="ruby-ivar">@version</span> = <span class="ruby-identifier">arch</span>.<span class="ruby-identifier">version</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;invalid argument #{arch.inspect}&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-sort_priority" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">sort_priority</span><span
                                class="method-args">(platform)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="sort_priority-source">
            <pre><span class="ruby-comment"># File rubygems/platform.rb, line 50</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">sort_priority</span>(<span class="ruby-identifier">platform</span>)
  <span class="ruby-identifier">platform</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span><span class="ruby-operator">::</span><span class="ruby-constant">RUBY</span> <span class="ruby-operator">?</span> <span class="ruby-value">-1</span> <span class="ruby-operator">:</span> <span class="ruby-value">1</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Class Methods</h3>
                </header>

                  <div id="method-c-match_platforms-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">match_platforms?</span><span
                                class="method-args">(platform, platforms)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="match_platforms-3F-source">
            <pre><span class="ruby-comment"># File rubygems/platform.rb, line 30</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">match_platforms?</span>(<span class="ruby-identifier">platform</span>, <span class="ruby-identifier">platforms</span>)
  <span class="ruby-identifier">platform</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">platform</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">platform</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span>)
  <span class="ruby-identifier">platforms</span>.<span class="ruby-identifier">any?</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">local_platform</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">platform</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span>
      <span class="ruby-identifier">local_platform</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">platform</span> <span class="ruby-operator">||</span>
      (<span class="ruby-identifier">local_platform</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span><span class="ruby-operator">::</span><span class="ruby-constant">RUBY</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">platform</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">local_platform</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-3D-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">==</span><span
                                class="method-args">(other)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Is <code>other</code> equal to this platform?  Two platforms are equal if they have the same CPU, OS and version.</p>

                              <div class="method-source-code" id="3D-3D-source">
            <pre><span class="ruby-comment"># File rubygems/platform.rb, line 150</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">==</span>(<span class="ruby-identifier">other</span>)
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">other</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">to_a</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">to_a</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>

                            <div class="aliases">
                              Also aliased as: <a href="Platform.html#method-i-eql-3F">eql?</a>
                            </div>

                          </div>

                  <div id="method-i-3D-3D-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">===</span><span
                                class="method-args">(other)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Does <code>other</code> match this platform?  Two platforms match if they have the same CPU, or either has a CPU of ‘universal’, they have the same OS, and they have the same version, or either one has no version</p>

<p>Additionally, the platform will match if the local CPU is ‘arm’ and the other CPU starts with “arm” (for generic ARM family support).</p>

<p>Of note, this method is not commutative. Indeed the OS ‘linux’ has a special case: the version is the libc name, yet while “no version” stands as a wildcard for a binary gem platform (as for other OSes), for the runtime platform “no version” stands for ‘gnu’. To be able to distinguish these, the method receiver is the gem platform, while the argument is the runtime platform.</p>

                              <div class="method-source-code" id="3D-3D-3D-source">
            <pre><span class="ruby-comment"># File rubygems/platform.rb, line 178</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">===</span>(<span class="ruby-identifier">other</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">other</span>

  <span class="ruby-comment"># universal-mingw32 matches x64-mingw-ucrt</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> (<span class="ruby-ivar">@cpu</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;universal&quot;</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">cpu</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;universal&quot;</span>) <span class="ruby-operator">&amp;&amp;</span>
                 <span class="ruby-ivar">@os</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">&quot;mingw&quot;</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">os</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">&quot;mingw&quot;</span>)

  <span class="ruby-comment"># cpu</span>
  ([<span class="ruby-keyword">nil</span>,<span class="ruby-string">&quot;universal&quot;</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-ivar">@cpu</span>) <span class="ruby-operator">||</span> [<span class="ruby-keyword">nil</span>, <span class="ruby-string">&quot;universal&quot;</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">other</span>.<span class="ruby-identifier">cpu</span>) <span class="ruby-operator">||</span> <span class="ruby-ivar">@cpu</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">cpu</span> <span class="ruby-operator">||</span>
  (<span class="ruby-ivar">@cpu</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;arm&quot;</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">cpu</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">&quot;arm&quot;</span>))) <span class="ruby-operator">&amp;&amp;</span>

    <span class="ruby-comment"># os</span>
    <span class="ruby-ivar">@os</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">os</span> <span class="ruby-operator">&amp;&amp;</span>

    <span class="ruby-comment"># version</span>
    (
      (<span class="ruby-ivar">@os</span> <span class="ruby-operator">!=</span> <span class="ruby-string">&quot;linux&quot;</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-ivar">@version</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">version</span>.<span class="ruby-identifier">nil?</span>)) <span class="ruby-operator">||</span>
      (<span class="ruby-ivar">@os</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;linux&quot;</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">normalized_linux_version</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">normalized_linux_version</span> <span class="ruby-operator">||</span> [<span class="ruby-node">&quot;musl#{@version}&quot;</span>, <span class="ruby-node">&quot;musleabi#{@version}&quot;</span>, <span class="ruby-node">&quot;musleabihf#{@version}&quot;</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">other</span>.<span class="ruby-identifier">version</span>))) <span class="ruby-operator">||</span>
      <span class="ruby-ivar">@version</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">version</span>
    )
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-3D~" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">=~</span><span
                                class="method-args">(other)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Does <code>other</code> match this platform?  If <code>other</code> is a String it will be converted to a <a href="Platform.html"><code>Gem::Platform</code></a> first.  See <a href="Platform.html#method-i-3D-3D-3D"><code>===</code></a> for matching rules.</p>

                              <div class="method-source-code" id="3D~-source">
            <pre><span class="ruby-comment"># File rubygems/platform.rb, line 216</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">=~</span>(<span class="ruby-identifier">other</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">other</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span> <span class="ruby-keyword">then</span> <span class="ruby-comment"># nop</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span> <span class="ruby-keyword">then</span>
    <span class="ruby-comment"># This data is from http://gems.rubyforge.org/gems/yaml on 19 Aug 2007</span>
    <span class="ruby-identifier">other</span> = <span class="ruby-keyword">case</span> <span class="ruby-identifier">other</span>
            <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^i686-darwin(\d)/</span>     <span class="ruby-keyword">then</span> [<span class="ruby-string">&quot;x86&quot;</span>,       <span class="ruby-string">&quot;darwin&quot;</span>,  <span class="ruby-node">$1</span>]
            <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^i\d86-linux/</span>         <span class="ruby-keyword">then</span> [<span class="ruby-string">&quot;x86&quot;</span>,       <span class="ruby-string">&quot;linux&quot;</span>,   <span class="ruby-keyword">nil</span>]
            <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;java&quot;</span>, <span class="ruby-string">&quot;jruby&quot;</span>        <span class="ruby-keyword">then</span> [<span class="ruby-keyword">nil</span>,         <span class="ruby-string">&quot;java&quot;</span>,    <span class="ruby-keyword">nil</span>]
            <span class="ruby-keyword">when</span> <span class="ruby-regexp">/^dalvik(\d+)?$/</span>       <span class="ruby-keyword">then</span> [<span class="ruby-keyword">nil</span>,         <span class="ruby-string">&quot;dalvik&quot;</span>,  <span class="ruby-node">$1</span>]
            <span class="ruby-keyword">when</span> <span class="ruby-regexp">/dotnet(\-(\d+\.\d+))?/</span> <span class="ruby-keyword">then</span> [<span class="ruby-string">&quot;universal&quot;</span>,<span class="ruby-string">&quot;dotnet&quot;</span>,  <span class="ruby-node">$2</span>]
            <span class="ruby-keyword">when</span> <span class="ruby-regexp">/mswin32(\_(\d+))?/</span>    <span class="ruby-keyword">then</span> [<span class="ruby-string">&quot;x86&quot;</span>,       <span class="ruby-string">&quot;mswin32&quot;</span>, <span class="ruby-node">$2</span>]
            <span class="ruby-keyword">when</span> <span class="ruby-regexp">/mswin64(\_(\d+))?/</span>    <span class="ruby-keyword">then</span> [<span class="ruby-string">&quot;x64&quot;</span>,       <span class="ruby-string">&quot;mswin64&quot;</span>, <span class="ruby-node">$2</span>]
            <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;powerpc-darwin&quot;</span>       <span class="ruby-keyword">then</span> [<span class="ruby-string">&quot;powerpc&quot;</span>,   <span class="ruby-string">&quot;darwin&quot;</span>,  <span class="ruby-keyword">nil</span>]
            <span class="ruby-keyword">when</span> <span class="ruby-regexp">/powerpc-darwin(\d)/</span>   <span class="ruby-keyword">then</span> [<span class="ruby-string">&quot;powerpc&quot;</span>,   <span class="ruby-string">&quot;darwin&quot;</span>,  <span class="ruby-node">$1</span>]
            <span class="ruby-keyword">when</span> <span class="ruby-regexp">/sparc-solaris2.8/</span>     <span class="ruby-keyword">then</span> [<span class="ruby-string">&quot;sparc&quot;</span>,     <span class="ruby-string">&quot;solaris&quot;</span>, <span class="ruby-string">&quot;2.8&quot;</span>]
            <span class="ruby-keyword">when</span> <span class="ruby-regexp">/universal-darwin(\d)/</span> <span class="ruby-keyword">then</span> [<span class="ruby-string">&quot;universal&quot;</span>, <span class="ruby-string">&quot;darwin&quot;</span>,  <span class="ruby-node">$1</span>]
            <span class="ruby-keyword">else</span> <span class="ruby-identifier">other</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">other</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">other</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">self</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">other</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-eql-3F" class="method-detail method-alias">
                            <div class="method-heading">
                              <span class="method-name">eql?</span><span
                                class="method-args">(other)</span>
                            </div>

                            <div class="method-description">
                              

                            </div>


                            <div class="aliases">
                              Alias for: <a href="Platform.html#method-i-3D-3D">==</a>
                            </div>
                          </div>

                  <div id="method-i-normalized_linux_version" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">normalized_linux_version</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="normalized_linux_version-source">
            <pre><span class="ruby-comment"># File rubygems/platform.rb, line 203</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">normalized_linux_version</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@version</span>

  <span class="ruby-identifier">without_gnu_nor_abi_modifiers</span> = <span class="ruby-ivar">@version</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/\Agnu/</span>, <span class="ruby-string">&quot;&quot;</span>).<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/eabi(hf)?\Z/</span>, <span class="ruby-string">&quot;&quot;</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">without_gnu_nor_abi_modifiers</span>.<span class="ruby-identifier">empty?</span>

  <span class="ruby-identifier">without_gnu_nor_abi_modifiers</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-to_a" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">to_a</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="to_a-source">
            <pre><span class="ruby-comment"># File rubygems/platform.rb, line 138</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_a</span>
  [<span class="ruby-ivar">@cpu</span>, <span class="ruby-ivar">@os</span>, <span class="ruby-ivar">@version</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-to_s" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">to_s</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="to_s-source">
            <pre><span class="ruby-comment"># File rubygems/platform.rb, line 142</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_s</span>
  <span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">join</span> <span class="ruby-string">&quot;-&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is a service of <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>, purveyors of fine <a href='https://jamesbritt.bandcamp.com/'>dance noise</a></p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

